#[derive(Debug)]
struct Foo;

impl Foo {
    fn mutate_and_share(&mut self) -> &Self {
        &*self
    }
    fn share(&self) {}
}

fn test() {
    let mut foo = Foo;
    foo.share();
    let loan = foo.mutate_and_share();
    println!("{:?}", loan);
    let x = "value";
    let y = "valu";
    longest(x, y);
    longest2(x, y);
}
fn longest(x: &str, y: &str) -> String {
    let z: String;
    if x.len() > y.len() {
        z = x.to_string();
    } else {
        z = y.to_string();
    }
    z
}
fn longest2<'a>(x: &'a str, y: &'a str) -> &'a str {
    if x.len() > y.len() { x } else { y }
}
fn invalid_output() -> String {
    String::from("foo")
}
